<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateSystemNotifyUser extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('system_notify_user', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('notifyCenterId')->index('idx_notifyCenterId')->default(0)->comment('消息 ID');
            $table->unsignedTinyInteger('notifyCenterType')->default(0)->comment('消息类型');
            $table->unsignedBigInteger('userId')->index('userId')->default(0)->comment('接收人 ID');
            $table->unsignedInteger('readAt')->default(0)->comment('已读时间');

            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('createdByUid')->default(0)->comment('创建人');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->unsignedInteger('updatedByUid')->default(0)->comment('修改人');
            $table->unsignedTinyInteger('isDeleted')->default(0)->comment('是否删除');

            $table->collation = 'utf8mb4_general_ci';
            $table->comment   = '商家通知记录表';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('system_notify_user');
    }
}
